package com.siwei.eqi.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.siwei.eqi.pojo.entity.DeliveryTask;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author hzl
 * @date 2025年04月02日 16:18
 */
@Data
public class DelivertTaskInfoVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 任务id
     */
    @ApiModelProperty("任务id")
    private String taskId;

    /**
     * 任务编号
     */
    @ApiModelProperty("任务编号")
    private String taskNum;

    /**
     * 任务名称
     */
    @ApiModelProperty("任务名称")
    private String taskName;

    /**
     * 年份
     */
    @ApiModelProperty("年份")
    private String year;

    /**
     * 汇交指数
     */
    @ApiModelProperty("汇交指数")
    private Integer deliveryIndex;

    /**
     * 汇交区域名称
     */
    @ApiModelProperty("汇交区域名称")
    private String areaName;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    private String createdBy;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 接收单位
     */
    @ApiModelProperty("接收单位")
    private Integer receiveUnit;

    /**
     * 接收单位名称
     */
    @ApiModelProperty("接收单位名称")
    private String receiveUnitName;

    /**
     * 截止时间
     */
    @ApiModelProperty("截止时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadlineTime;

    /**
     * 任务状态1-进行中 2-已完成
     */
    private Integer status;

    public DelivertTaskInfoVO (DeliveryTask task) {
        this.taskId = task.getId();
        this.areaName = task.getAreaName();
        this.createdBy = task.getCreatedBy();
        this.deadlineTime = task.getDeadlineTime();
        this.status = task.getStatus();
        this.createTime = task.getCreateTime();
        this.deliveryIndex = task.getDeliveryIndex();
        this.receiveUnit = task.getReceiveUnit();
        this.taskName = task.getTaskName();
        this.taskNum = task.getTaskNum();
        this.year = task.getYear();
    }

}
